package com.xiaoming;

import java.util.concurrent.ThreadLocalRandom;

public class ClientBootStrap {

    public static void main(String[] args) throws InterruptedException {

        RpcConsumer rpcConsumer = new RpcConsumer();
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class);

        for (int i = 0; true; i++) {
            Thread.sleep(2000);
            User user = new User();
            user.setAge(i);
            boolean b = ThreadLocalRandom.current().nextBoolean();
            user.setGender("女");
            if(b){
                user.setGender("男");
            }
            user.setName("张"+i);
            user.setId(i);
            Object obj = proxy.sayHello(user);
            System.out.println(obj);
        }
    }
}
